<template>
  <div>
    <viewTitle :title="'已添加充值账户'" :border="false"></viewTitle>
    <div>
      <el-table
        :data="tableData"
        style="width: 100%"
        :header-cell-style="getRowClass"
        :select-on-indeterminate="true"
        :fit="true"
        :lazy="true"
        border
      >
            <el-table-column type="index" label="序号" width="100"></el-table-column>
            <el-table-column prop="bank_account_name" label="开户名称" width="180"></el-table-column>
            <el-table-column prop="bank_name" label="开户银行"></el-table-column>
            <el-table-column prop="bank_sn" label="银行账号"></el-table-column>
      </el-table>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      tableData: [],
      pagination:{},
    };
  },
  methods: {
    //    修改第一行样式
    getRowClass({ row, column, rowIndex, columnIndex }) {
      if (rowIndex === 0) {
        return "background: #FAFAFA ";
      } else {
        return "";
      }
    },
    //     点击单行
    clickRow(row, column, event) {
      console.log(row, column, event);
    },
    //    修改是否换行
    changeStyleRow(width) {
      let _width = width - 290 - 350 - 300 - 50 - 25;
      if (_width > 300) {
        this.marginLeft = 25;
      } else {
        this.marginLeft = 0;
      }
    },
    getData() {
      let data = this.$api.sendSync(this.$mapapi.e_bankAccount, {});
      if (data.code != 200&&data.code!=501) {
        this.$message.error(data.msg);
        return;
      }
      this.pagination = data.data.pagination;
      this.tableData = data.data.data || [];
    },    
  },
  mounted() {
      this.getData();
  },
  created() {}
};
</script>

<style lang="less"  :scope="true">
</style>